﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void _button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("main id:" + Thread.CurrentThread.ManagedThreadId);

            var task = Task.Factory.StartNew(() =>
             {
                 var id = Thread.CurrentThread.ManagedThreadId;

                 MessageBox.Show("task id:" + id);
                 Thread.Sleep(2000);
             });//.Wait();
            while (!task.IsCompleted)
            {

            }
            MessageBox.Show("Test2");
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Process.Start("OnLineLogFileClient.Move.exe",
                                        "-s OnLineLogFileClient.exe -f update_bin\\ -t bin\\");
        }
    }
}
